package org.coody.gitee.entrance;

import org.coody.gitee.config.FuzzerConfig;
import org.coody.gitee.entity.GiteeEntity;
import org.coody.gitee.fuzzer.iface.GiteeFuzzer;
import org.coody.gitee.handle.AccountHandle;

public class FuzzerEntrance {

	/**
	 * 程序主方法
	 * 
	 * @param args
	 */
	public static void main(String[] args) {

		// 执行十次
		for (int i = 0; i < 10; i++) {
			doFuzzer();
		}
	}

	private static void doFuzzer() {
		try {
			GiteeEntity entity = new GiteeEntity();
			String account = AccountHandle.createAccount();
			entity.setAccount(account);
			entity.setSpace(account);
			// 密码默认在用户名后添加520
			entity.setPassword(account + "520");
			entity.setProjects(FuzzerConfig.projects);
			for (GiteeFuzzer fuzzer : FuzzerConfig.fuzzers) {
				fuzzer.fuzzer(entity);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
